<template>
	<view>
		<view class="margin_content wid90 mar">
			<view style="height: 20rpx;"></view>
			<view class="textCen foSi30 fowe600 mar-bott20">{{title}}</view>
			<!-- <rich-text class="wid100" style="overflow: hidden;" :nodes="data"></rich-text> -->
			<uv-parse class="wid100" style="overflow: hidden;" :content="data"></uv-parse>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '',
				data: '',
				type: '',

			}
		},
		onLoad(options) {
			this.title = options.type == 1?'隐私政策':'用户服务协议'
			this.type = options.type
			
			this.list()
		},
		methods: {
			list() {
				var that = this
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/common/agreement',
					method: 'POST',
					header: {
						'site-id': that.global.site_id
					},
					data: {
						type: that.type == 3?2:that.type
					},
					success: (res) => {
						let result = res.data
						if (result.code == 1) {
							var data = result.data
							data = data.replace(/<img/gi, "<img class='richImg'");
							console.log(result)
							that.data = data
						} else {
							uni.showToast({
								title: result.msg,
								icon: 'error'
							})
						}
					},
					complete() {
						uni.hideLoading()
					}
				});
			},
		}
	}
</script>

<style>
	.richImg {
		width: 100% !important;
		height: auto !important;
	}

</style>